How to Modify a set of Linkset Paring

Hi Everybody
I'm trying too modify a set of linkSet Pairing using linkModuleDescriptor Function.
I have tried this code below bui it goes goes on error
Thanks in advance

Folder f = current
Module m = current
 
LinkModuleDescriptor linkModDesc
string linkDescName
string modSource
string modTarget
string fullModName
string fullFolderName
string msg =""
 
fullModName = fullName(m)
fullFolderName = fullName(f)
 
for linkModDesc in f do {
    linkDescName = name(linkModDesc)
        //linkDescName = getName(linkModDesc)
        modSource    = getSourceName(linkModDesc) 
        modTarget    = getTargetName(linkModDesc)
        if ((linkDescName == "/MyProject/satisfies") && (modSource == fullModName))
        {
                print linkDescName "\t"modSource "\t\t\t"modTarget "\n" 
                //msg removeLinkModuleDescriptor(f,modSource,modTarget)
                msg =  addLinkModuleDescriptor(f,modSource,modTarget, false, "/MyProject/satisfies_bis","")
        
        }
}

dooors - Tue Mar 01 12:49:03 EST 2011

Re: How to Modify a set of Linkset Paring
llandale - Tue Mar 01 12:59:23 EST 2011

I would suppose you would need to first remove the OLD LMD before trying to create a new one between the same Source and Target modules.

Actually, my guess is that you would want to remove the old one if it exists, and after checking that THEN try to add the new one. The code you have would only modify an existing one, not add it if it doesn't exist.

Get into the habit of printing your non-null errors, msg in this case.

  • Louie